<?php
require_once BaseUtil::getModulePath("base")  .  '/forms/BaseForm.php';

class SalePriceForm extends BaseForm {

    	public function __construct (){
            
            parent::__construct();
            $this->setAction(HttpUtil::getUrl("promotion", "subsaleprice"));
            // amount
            $amount = new Zend_Form_Element_Text('amount');
            $amount->setLabel($this->translate->_('discountAmount'));
            $amount->addFilter("StringTrim");
            $amount->setRequired(true);

            //action
            $action = new Zend_Form_Element_Select("action");
            $action->setLabel($this->translate->_('action'));
            $action->setRequired(true);
            $action->setMultiOptions(array(1=>$this->translate->_('percentOff'),2=>$this->translate->_('amountOff')));

            // from
            $from = new Zend_Form_Element_Text('from');
            $from->setLabel($this->translate->_('from'));
            $from->addFilter("StringTrim");
            $from->setRequired(true);

            // to
            $to = new Zend_Form_Element_Text('to');
            $to->setLabel($this->translate->_('to'));
            $to->addFilter("StringTrim");
            $to->setRequired(true);

            $this->addElements(array($amount,$action,$product,$from,$to));


            $this->setElementDecorators(array(
            'ViewHelper',
            array(array('div' => 'HtmlTag'), array('tag' => 'div',"class" => "form_element")),
            ));
        }
}